﻿@model InformaticaDiaryWeb.Models.SearchCriteriaModel

@{
    ViewBag.Title = "ResultIndex";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<style type="text/css">
    .gridTable
    {
        margin: 5px;
        padding: 10px;
        border: 1px #c8c8c8 solid;
        border-collapse: collapse;
        min-width: 550px;
        background-color: #fff;
        color: #fff;
    }
    .gridHead th
    {
        font-weight: bold;
        background-color: #030D8D;
        color: #fff;
        padding: 10px;
    }
    .gridHead a:link, .gridHead a:visited, .gridHead a:active, .gridHead a:hover
    {
        color: #fff;
    }
    .gridHead a:hover
    {
        text-decoration: underline;
    }
    .gridTable tr.gridAltRow
    {
        background-color: #efeeef;
    }
    .gridTable tr:hover
    {
        background-color: #f6f70a;
    }
    .gridAltRow td
    {
        padding: 10px;
        margin: 5px;
        color: #333;
    }
    .gridRow td
    {
        padding: 10px;
        color: #333;
    }
    .gridFooter td
    {
        padding: 10px;
        background-color: #c7d1d6;
        color: #999;
        font-size: 12pt
        text-align: center;
       
    }
    .gridFooter a
    {
       @* font-weight: bold;
        color: #333;
        border: 1px #333 solid;*@
    }
</style>
@{
    var grid = new WebGrid(Model.objSearchResult, defaultSort: "sCourtName");
}
@using (Html.BeginForm())
{
    @Html.ValidationSummary()   
    <div data-role="collapsible-set">
        <div data-role="collapsible" data-collapsed="true">
            <h4>Search</h4>
            <ul data-role="listview" data-inset="true">
                <li data-role="list-divider">Search</li>
                <li data-role="fieldcontain">
                    @Html.LabelFor(m => m.CaseTypeID)
                    @Html.DropDownListFor(x => x.CaseTypeID, Model.listCaseType)
                </li>
                <li data-role="fieldcontain">
                    @Html.LabelFor(m => m.CaseYear)
                    @Html.DropDownListFor(x => x.CaseYear, Model.listCaseYear)
                </li>
                <li data-role="fieldcontain">
                    @Html.LabelFor(m => m.strCaseNo)
                    @Html.EditorFor(x => x.strCaseNo)
                    @Html.ValidationMessageFor(x => x.strCaseNo)
                </li>
                <li data-role="fieldcontain">
                    <input type="submit" value="Search" data-icon="search" />
                </li>
            </ul>
        </div>
        <div data-role="collapsible" data-collapsed="false">
            <h4>Results</h4>
            @if (Model.objSearchResult == null || Model.objSearchResult.Count() < 1)
            {
                <ul data-role="listview" data-inset="true">
                    <li data-role="fieldcontain">No Results found.</li>
                </ul>
            }
            else
            {
                  
                @grid.GetHtml(
                            selectedRowStyle: "webgrid-selected-row",
                            tableStyle: "gridTable",
                            headerStyle: "gridHead",
                            footerStyle: "gridFooter",
                            rowStyle: "gridRow",
                            alternatingRowStyle: "gridAltRow",

                            mode: WebGridPagerModes.All,

                            columns: grid.Columns(
                            grid.Column("sCaseType", header: "Case Type", canSort: false),
                            grid.Column("sCaseNoYear", header: "CaseNo/Year ", canSort: false),
                            grid.Column("sPetitioner", header: "Petitioner", canSort: false),
                            grid.Column("sRespondant", header: "Respondant", canSort: false),
                            grid.Column("", format: @<text>@Html.ActionLink("View", "CaseItem", "Result", new { id = item.CaseDetailsID }, null)</text>)

                            )
                            )
                   
            }
        </div>
    </div>
}
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}